 //UL4D2 MaxPlayers
#define L4D2_MAXPLAYERS 32

//UL4D2 Teams
#define TEAM_UNKNOWN 0
#define TEAM_SPECTATOR 1
#define TEAM_SURVIVOR 2
#define TEAM_INFECTED 3

//UL4D2 ZombieClasses
#define ZC_UNKNOWN0
#define ZC_SMOKER 1
#define ZC_BOOMER 2
#define ZC_HUNTER 3
#define ZC_SPITTER 4
#define ZC_JOCKEY 5
#define ZC_CHARGER 6
#define ZC_WITCH 7
#define ZC_TANK 8
#define ZC_NOT_INFECTED 9     //survivor

//fake bool fix
#define _FALSE 0
#define _TRUE 1

stock bool:IsValidAliveSurv(client){

if(!IsClientInGame(client)) return false;

if(!IsPlayerAlive(client)) return false;

if(GetClientTeam(client) != TEAM_SURVIVOR) return false;

return true;

}

//returns integer NOT boolean
stock GetValidAliveZC(client){

if(!IsClientInGame(client)) return _FALSE;

if(!IsPlayerAlive(client)) return _FALSE;

if(GetClientTeam(client) != TEAM_INFECTED) return _FALSE;

if(GetEntProp(client, Prop_Send, "m_isGhost")) return _FALSE;

return GetEntProp(client, Prop_Send, "m_zombieClass");

}

public IsValidClient(client){
	
	if (client == 0)
	return false;
	
	if (!IsClientConnected(client))
	return false;
	
	if (!IsClientInGame(client))
	return false;
	
	if (IsFakeClient(client))
	return false;
	
	return true;

}

public bool:IsPlayerTank(client)
{
	new String:class[150];
	GetClientModel(client, class, sizeof(class));
	return (StrContains(class, "hulk", false) != -1);
}

public PlayerCounter(){
	new PlayCount = 0;
	for (new i_client=1; i_client<=GetMaxClients(); i_client++)
	{
		if(IsValidClient(i_client) && GetClientTeam(i_client) == TEAM_SURVIVOR)
			{
				PlayCount++;
			}
	}
	return PlayCount;
}